package com.it.web.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.it.common.domain.dos.BlogSettingsDO;
import com.it.common.mapper.BlogSettingsMapper;
import com.it.common.utils.Response;
import com.it.web.convert.BlogSettingsConvert;
import com.it.web.model.vo.blogsettings.FindBlogSettingsDetailRspVO;
import com.it.web.service.BlogSettingsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Service
@Slf4j
public class BlogSettingsServiceImpl extends ServiceImpl<BlogSettingsMapper, BlogSettingsDO> implements BlogSettingsService {

    @Resource
    private BlogSettingsMapper blogSettingsMapper;


    @Override
    public Response findDetail() {
        // 查询博客设置信息（约定的 ID 为 1）
        BlogSettingsDO blogSettingsDO = blogSettingsMapper.selectById(1L);

        // DO 转 VO
        FindBlogSettingsDetailRspVO vo = BlogSettingsConvert.INSTANCE.convertDO2VO(blogSettingsDO);

        return Response.success(vo);
    }
}
